﻿using Modules.Person;
using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.Person;

/// <summary>
/// 工人企业合同表
///</summary>
[TableName("person_corp_contract")]
[Description("人员合同表,人员和企业关联")]
[PrimaryKey("id", AutoIncrement = true)]
[CacheSetting(true)]
[Serializable]
public class PersonCorpContract : IEntity
{
    /// <summary>
    /// 主键
    ///</summary>
    [Column("id")]
    public int Id { get; set; }

    /// <summary>
    /// 合同编号
    ///</summary>
    [Column("code")]
    public string Code { get; set; }

    /// <summary>
    /// 人员Id
    ///</summary>
    [Column("person_id")]
    public int PersonId { get; set; }
    /// <summary>
    /// 项目id
    /// </summary>
    [Column("project_id")]
    public int ProjectId { get; set; }
    /// <summary>
    /// 企业Id
    ///</summary>
    [Column("corp_id")]
    public int CorpId { get; set; }

    /// <summary>
    /// 合同类型
    ///</summary>
    [Column("type")]
    public 合同类型 Type { get; set; }

    /// <summary>
    /// 签订类型
    ///</summary>
    [Column("signing_type")]
    public 合同签订类型 SigningType { get; set; }

    /// <summary>
    /// 合同签订日期
    ///</summary>
    [Column("signing_date")]
    public DateTime SigningDate { get; set; }

    /// <summary>
    /// 合同起始日期
    ///</summary>
    [Column("start_date")]
    public DateTime StartDate { get; set; }

    /// <summary>
    /// 合同终止日期
    ///</summary>
    [Column("end_date")]
    public DateTime EndDate { get; set; }

    /// <summary>
    /// 工资计算方式
    ///</summary>
    [Column("salary_calculation_method")]
    public 工资计算方式 SalaryCalculationMethod { get; set; }

    /// <summary>
    /// 工资标准
    ///</summary>
    [Column("wage_standard")]
    public decimal WageStandard { get; set; }

    /// <summary>
    /// 工资支付日期
    ///</summary>
    [Column("salary_payment_date")]
    public int SalaryPaymentDate { get; set; }

    /// <summary>
    /// 创建时间
    ///</summary>
    [Column("create_date")]
    public DateTime CreateDate { get; set; }

    #region IEntity 成员

    [Ignore]
    object IEntity.EntityId { get { return this.Id; } }

    #endregion IEntity 成员
}